package com.ethink.system.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.system.api.info.SystemApiAuthorityInfo;
import com.ethink.system.common.entity.SystemApiAuthority;

/**
 * 系统接口权限表 Converter转换器
 *
 * @author default
 * @date 2022-09-26
 */
@Component
public class SystemApiAuthorityConverter implements Converter<SystemApiAuthorityInfo, SystemApiAuthority> {

    @Override
    public SystemApiAuthority convertTo(SystemApiAuthorityInfo info) {
        if(info == null) {
            return null;
        }
        SystemApiAuthority entity = new SystemApiAuthority ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public SystemApiAuthorityInfo convertFrom(SystemApiAuthority entity) {
        if(entity == null) {
            return null;
        }
        SystemApiAuthorityInfo info = new SystemApiAuthorityInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
